package com.advice;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Component
@Aspect     //TODO：定义为切面类
public class MyAdvice {
    @Pointcut("execution(void com.dao.UserDao.save())")
    public void pt(){}

    @Before("pt()")
    public void before() {
        long l = System.currentTimeMillis();
        System.out.println(l);
    }
}
